package com.mall.concurrency.threadLocal;

/**
 * @Author:zwy
 * @Despriction:
 * @Date:Create in 19:33 2018/5/29
 * @Modify By:
 */
public class RequestHolder {
    private final static ThreadLocal<Long> requestHolder = new ThreadLocal<>();
    public static void add(Long id){

        requestHolder.set(id);
    }
    public static Long getId(){
        return requestHolder.get();
    }
    public static void remove(){
        requestHolder.remove();
    }
}
